/*
 * @Description: 你的代码我的心
 * @Author: GGB
 * @Date: 2021-12-27 09:34:45
 * @LastEditors: GGB
 * @LastEditTime: 2021-12-27 13:48:41
 */

import {
  StaffPageParms,
  UpdateStaffState,
  DelParams,
  StaffListGetResultModel,
  AddForm,
} from './model/staffModel';
import { defHttp } from '/@/utils/http/axios';

import { BasicResult } from '../model/baseModel';

enum Api {
  StaffList = '/store.user/list',
  StaffDetail = '/store.user/detail',
  AddStaff = '/store.user/add',
  EditStaff = '/store.user/edit',
  DeleteStaff = '/store.user/delete',
}
/**
 * 获取员工列表
 */
export const getStaffList = (params: StaffPageParms) =>
  defHttp.get<StaffListGetResultModel>({ url: Api.StaffList, params });

/**
 * 编辑员工
 * @param params
 * @returns
 */
export const updateStaff = (params: UpdateStaffState) =>
  defHttp.post<BasicResult>({ url: Api.EditStaff, params });

/**
 * 添加员工
 * @param params
 * @returns
 */
export const addStaff = (params: AddForm) =>
  defHttp.post<BasicResult>({ url: Api.AddStaff, params });

/**
 * 删除员工
 * @param params
 * @returns
 */
export const delStaff = (params: DelParams) =>
  defHttp.post<BasicResult>({ url: Api.DeleteStaff, params });
